package com.yitong.equipment.entity.other

import com.yitong.equipment.entity.other.MineConfigColumnBadge

/**
 * @author Sun
 * @date 2018/12/12 14:14
 * @desc column 的标记model
 */
class MineConfigColumnBadge {
    /**
     * 标记类型
     *
     * @return 1:小红点, 2:数量, 3:图标
     */
    var type // 1:小红点, 2:数量, 3:图标
            = 0
        private set
    var count = 0
        private set
    var icon = 0
        private set

    private constructor() {}
    private constructor(type: Int, count: Int, icon: Int) {
        this.type = type
        this.count = count
        this.icon = icon
    }

    companion object {
        fun createEmptyBadge(): MineConfigColumnBadge {
            return MineConfigColumnBadge()
        }

        fun createPointBadge(showPoint: Boolean): MineConfigColumnBadge {
            return MineConfigColumnBadge(if (showPoint) 1 else 0, 0, 0)
        }

        fun createUnreadBadge(unreadCount: Int): MineConfigColumnBadge {
            return MineConfigColumnBadge(2, unreadCount, 0)
        }

        fun createIconBadge(resId: Int): MineConfigColumnBadge {
            return MineConfigColumnBadge(3, 0, resId)
        }
    }
}